{template head}
<script type="text/javascript">
var ajaxparam = {
		'url' : '{SITE_URL}/ajax/index.php'
};
function deladmin(id,status,str){
	if(id)
	{
		
		layer.confirm('你确定执行'+str+'操作吗？', {
		  time: 0 //不自动关闭
		  ,btn: ['很确定', '点错了']
		  ,yes: function(index){
		    layer.close(index);
		    
		    
		    var url = ajaxparam.url + '?m=ggStatus';
			var data = {
					'id' : id,
					'status':status,
					'str':str,
			};
			var callback = function(data){
				if(data.sign == 1)
				{
					layer.alert(data.msg,function(){
						window.location = window.location;
					});
				}
				else
				{
					if(data.msg)
					{
						layer.msg(data.msg);
					}
					else
					{
						layer.msg('操作失败');
					}
				}
			};
			makeAjax('post',url,data,callback);
		    
		    
		    
		    
		    
		    
		    
		    
		  }
		});
		
		
		
		
	}else{
		alert('参数错误');
	}
}
</script>
<body>
<div class="wrapper">
	<div class="crumbs"><span style="margin: 0 5px;color: #333;font-size: 14px;">内容管理</span> &gt; <span>公告管理</span> </div>
	
	<div class="container_tit clearfix mb20 ft14">
	
	<form action="{SITE_URL}index.php?a={$action}" method="get">
		<input type="hidden" name="a" value="{$action}" />
        
        
        <div class="btn_box fl" style="padding-top:5px;">
        	<span>发布时间段</span>
        	<input type="text" class="w200 text" style="width:200px;" class="text" format='date' name='start' id="start" value="{$parm['start']}" placeholder="请输入日期">
			<span>至</span>
			<input type="text" class="mr15 w200 text" style="width:200px;" class="text" format='date' name='end' id="end" value="{$parm['end']}" placeholder="请输入日期">
       </div>
       
       <div class="choose fl mr15" style="padding-top:5px;">
        	<span>公告状态</span>
            <select class="select w150" name="status">
            	<option value="">请选择</option>
            	<option {if $parm['status']=='1'}selected{/if} value="1">启用</option>
            	<option {if $parm['status']=='2'}selected{/if} value="2">禁用</option>
            </select>
        </div>
        
        <div class="btn_box fl" style="padding-top:5px;">
        	<input type="submit" name="submit" class="btnblue mr15" value="搜索">
        </div>
        
         <div class="btn_box fl" style="padding-top:5px;">
         	{if adminpermission('N','110000','110001')}
        	<a href="{SITE_URL}index.php?a={$action}&m=addGG" class="btnyellow mr15">创建公告</a>
        	{/if}
         </div>
    </form>
    </div>
	
	<!-- list -->
	<table class="table">
		<thead>
			<tr class="bg_h_1">
				<th width="60%">标题</th>
				<th width="">发布时间</th>
				<th width="">公告状态</th>
            	<th width="">操作</th>
			</tr>
		</thead>
		<tbody>
		<!--{loop $list $key $one}-->
			<tr>
				<td style="text-align: center;">{$one['title']}</td>
				<td style="text-align: center;">{php echo time_formart($one['fbtime'],2)}</td>
				<td style="text-align: center;">
					{if $one[status] == 1}
						禁用
					{elseif $one[status] == 2}
						启用
					{/if}
				</td>
				<td style="text-align: center;">
					{if $one[status] == 1}
						{if adminpermission('N','110000','110003')}
						<a href="javascript:;" onclick="deladmin('{$one[id]}','2','启用')" class="btn_set"  title="启用">启用</a>
						{/if}
						{if adminpermission('N','110000','110004')}
						<a href="javascript:;" onclick="deladmin('{$one[id]}','3','删除')" class="btn_del"  title="删除">删除</a>
						{/if}
					{elseif $one[status] == 2}
						{if adminpermission('N','110000','110003')}
						<a href="javascript:;" onclick="deladmin('{$one[id]}','1','禁用')" class="btn_set"  title="禁用">禁用</a>
						{/if}
					{/if}
					{if adminpermission('N','110000','110002')}
					<a class="btn_edit" href="{SITE_URL}index.php?a={$action}&m=editGG&id={$one[id]}"  title="编辑">编辑</a>
					{/if}
				</td>
			</tr>
		<!--{/loop}-->
		</tbody>
	</table>
</div>

<!--{php pagenav($pageurl,$page,$pagetotal);}-->
{template foot}